package com.exam.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.exam.pojo.ExamManage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

public interface ExamManageMapper extends BaseMapper<ExamManage> {
    @Select("select * from exam_manage")
    List<ExamManage> findAll();
    @Select("select * from exam_manage")
    IPage<ExamManage> findAll(Page<ExamManage> examManagePage);
    @Select("select * from exam_manage where examCode=#{examCode}")
    ExamManage findById(Integer examCode);
    @Delete("delete from exam_manage where examCode=#{examCode}")
    int deleteByIds(Integer examCode);

    @Select("select paperId from exam_manage order by paperId desc limit 1")
    ExamManage ManagePaperId();
}
